num1 = 1
str1 = "10"
# float转换为浮点类型
print(type(float(num1)))
print(type(float(str1)))
# 转换成字符串
print(type(str(num1)))
# 转元组
list1 = [10, 20, 30]
print(tuple(list1))
# 转列表
tuple1 = (100, 200, 300)
print(list(tuple1))

str2 = '1'
str3 = '1.1'
str4 = '[10, 20, 30]'
str5 = '(100, 200, 300)'
# eval可以将字符串转化为python表达式，并一一返回对象
print(type(eval(str2)))
print(type(eval(str3)))
print(type(eval(str4)))
print(type(eval(str5)))
# 将python对象转化为字符串
print(repr(list1))
